Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type-level human-readable abi item parameters/scope/state mutability parsing #244

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

tmm
Copy link
Member

@tmm tmm commented Jun 28, 2024

Fixes #243


PR-Codex overview

This PR improves the parsing of human-readable ABI items with nested tuple parameters in the abitype package.

Detailed summary

  • Fixed parsing of human-readable ABI items with nested tuple parameters
  • Updated tests for nested tuples in parseAbiItem.test.ts
  • Added new type utilities for parsing function parameters and state mutability

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jun 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
abitype ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2024 4:38pm

Copy link

changeset-bot bot commented Jun 28, 2024

🦋 Changeset detected

Latest commit: c398a98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
abitype Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Size Change: +26 B (+0.02%)

Total Size: 116 kB

Filename Size Change
packages/abitype/dist/cjs/register.js 14.5 kB -7 B (-0.05%)
packages/abitype/dist/esm/register.js 15.7 kB -5 B (-0.03%)
packages/abitype/dist/types/human-readable/types/structs.d.ts 2.11 kB +38 B (+1.83%)
ℹ️ View Unchanged
Filename Size Change
packages/abitype/dist 0 B 0 B 🆕
packages/abitype/dist/cjs 123 B 0 B
packages/abitype/dist/cjs/abi.js 0 B 0 B 🆕
packages/abitype/dist/cjs/abis 3.59 kB 0 B
packages/abitype/dist/cjs/abis/human-readable.js 5.91 kB 0 B
packages/abitype/dist/cjs/abis/json.js 575 B 0 B
packages/abitype/dist/cjs/errors.js 0 B 0 B 🆕
packages/abitype/dist/cjs/exports 588 B 0 B
packages/abitype/dist/cjs/exports/abis.js 744 B 0 B
packages/abitype/dist/cjs/exports/index.js 567 B 0 B
packages/abitype/dist/cjs/exports/zod.js 0 B 0 B 🆕
packages/abitype/dist/cjs/human-readable 0 B 0 B 🆕
packages/abitype/dist/cjs/human-readable/errors 531 B 0 B
packages/abitype/dist/cjs/human-readable/errors/abiItem.js 801 B 0 B
packages/abitype/dist/cjs/human-readable/errors/abiParameter.js 425 B 0 B
packages/abitype/dist/cjs/human-readable/errors/signature.js 403 B 0 B
packages/abitype/dist/cjs/human-readable/errors/splitParameters.js 336 B 0 B
packages/abitype/dist/cjs/human-readable/errors/struct.js 286 B 0 B
packages/abitype/dist/cjs/human-readable/formatAbi.js 407 B 0 B
packages/abitype/dist/cjs/human-readable/formatAbiItem.js 477 B 0 B
packages/abitype/dist/cjs/human-readable/formatAbiParameter.js 300 B 0 B
packages/abitype/dist/cjs/human-readable/formatAbiParameters.js 339 B 0 B
packages/abitype/dist/cjs/human-readable/parseAbi.js 429 B 0 B
packages/abitype/dist/cjs/human-readable/parseAbiItem.js 460 B 0 B
packages/abitype/dist/cjs/human-readable/parseAbiParameter.js 519 B 0 B
packages/abitype/dist/cjs/human-readable/parseAbiParameters.js 0 B 0 B 🆕
packages/abitype/dist/cjs/human-readable/runtime 607 B 0 B
packages/abitype/dist/cjs/human-readable/runtime/cache.js 744 B 0 B
packages/abitype/dist/cjs/human-readable/runtime/signatures.js 1.02 kB 0 B
packages/abitype/dist/cjs/human-readable/runtime/structs.js 2.1 kB 0 B
packages/abitype/dist/cjs/human-readable/runtime/utils.js 0 B 0 B 🆕
packages/abitype/dist/cjs/human-readable/types 127 B 0 B
packages/abitype/dist/cjs/human-readable/types/signatures.js 125 B 0 B
packages/abitype/dist/cjs/human-readable/types/structs.js 124 B 0 B
packages/abitype/dist/cjs/human-readable/types/utils.js 160 B 0 B
packages/abitype/dist/cjs/narrow.js 40 B 0 B
packages/abitype/dist/cjs/package.json 369 B 0 B
packages/abitype/dist/cjs/regex.js 125 B 0 B
packages/abitype/dist/cjs/tsconfig.build.tsbuildinfo 124 B 0 B
packages/abitype/dist/cjs/types.js 124 B 0 B
packages/abitype/dist/cjs/utils.js 149 B 0 B
packages/abitype/dist/cjs/version.js 2.12 kB 0 B
packages/abitype/dist/cjs/zod.js 0 B 0 B 🆕
packages/abitype/dist/esm 62 B 0 B
packages/abitype/dist/esm/abi.js 0 B 0 B 🆕
packages/abitype/dist/esm/abis 3.95 kB 0 B
packages/abitype/dist/esm/abis/human-readable.js 6.26 kB 0 B
packages/abitype/dist/esm/abis/json.js 522 B 0 B
packages/abitype/dist/esm/errors.js 0 B 0 B 🆕
packages/abitype/dist/esm/exports 297 B 0 B
packages/abitype/dist/esm/exports/abis.js 403 B 0 B
packages/abitype/dist/esm/exports/index.js 279 B 0 B
packages/abitype/dist/esm/exports/zod.js 0 B 0 B 🆕
packages/abitype/dist/esm/human-readable 0 B 0 B 🆕
packages/abitype/dist/esm/human-readable/errors 448 B 0 B
packages/abitype/dist/esm/human-readable/errors/abiItem.js 670 B 0 B
packages/abitype/dist/esm/human-readable/errors/abiParameter.js 338 B 0 B
packages/abitype/dist/esm/human-readable/errors/signature.js 343 B 0 B
packages/abitype/dist/esm/human-readable/errors/splitParameters.js 280 B 0 B
packages/abitype/dist/esm/human-readable/errors/struct.js 271 B 0 B
packages/abitype/dist/esm/human-readable/formatAbi.js 401 B 0 B
packages/abitype/dist/esm/human-readable/formatAbiItem.js 568 B 0 B
packages/abitype/dist/esm/human-readable/formatAbiParameter.js 377 B 0 B
packages/abitype/dist/esm/human-readable/formatAbiParameters.js 479 B 0 B
packages/abitype/dist/esm/human-readable/parseAbi.js 593 B 0 B
packages/abitype/dist/esm/human-readable/parseAbiItem.js 560 B 0 B
packages/abitype/dist/esm/human-readable/parseAbiParameter.js 636 B 0 B
packages/abitype/dist/esm/human-readable/parseAbiParameters.js 0 B 0 B 🆕
packages/abitype/dist/esm/human-readable/runtime 848 B 0 B
packages/abitype/dist/esm/human-readable/runtime/cache.js 623 B 0 B
packages/abitype/dist/esm/human-readable/runtime/signatures.js 1.01 kB 0 B
packages/abitype/dist/esm/human-readable/runtime/structs.js 2.24 kB 0 B
packages/abitype/dist/esm/human-readable/runtime/utils.js 0 B 0 B 🆕
packages/abitype/dist/esm/human-readable/types 69 B 0 B
packages/abitype/dist/esm/human-readable/types/signatures.js 66 B 0 B
packages/abitype/dist/esm/human-readable/types/structs.js 64 B 0 B
packages/abitype/dist/esm/human-readable/types/utils.js 264 B 0 B
packages/abitype/dist/esm/narrow.js 58 B 0 B
packages/abitype/dist/esm/package.json 504 B 0 B
packages/abitype/dist/esm/regex.js 67 B 0 B
packages/abitype/dist/esm/tsconfig.build.tsbuildinfo 64 B 0 B
packages/abitype/dist/esm/types.js 64 B 0 B
packages/abitype/dist/esm/utils.js 82 B 0 B
packages/abitype/dist/esm/version.js 2.49 kB 0 B
packages/abitype/dist/esm/zod.js 0 B 0 B 🆕
packages/abitype/dist/types 1.84 kB 0 B
packages/abitype/dist/types/abi.d.ts 0 B 0 B 🆕
packages/abitype/dist/types/abis 3.88 kB 0 B
packages/abitype/dist/types/abis/human-readable.d.ts 5.96 kB 0 B
packages/abitype/dist/types/abis/json.d.ts 273 B 0 B
packages/abitype/dist/types/errors.d.ts 0 B 0 B 🆕
packages/abitype/dist/types/exports 260 B 0 B
packages/abitype/dist/types/exports/abis.d.ts 655 B 0 B
packages/abitype/dist/types/exports/index.d.ts 244 B 0 B
packages/abitype/dist/types/exports/zod.d.ts 0 B 0 B 🆕
packages/abitype/dist/types/human-readable 0 B 0 B 🆕
packages/abitype/dist/types/human-readable/errors 227 B 0 B
packages/abitype/dist/types/human-readable/errors/abiItem.d.ts 376 B 0 B
packages/abitype/dist/types/human-readable/errors/abiParameter.d.ts 245 B 0 B
packages/abitype/dist/types/human-readable/errors/signature.d.ts 203 B 0 B
packages/abitype/dist/types/human-readable/errors/splitParameters.d.ts 174 B 0 B
packages/abitype/dist/types/human-readable/errors/struct.d.ts 314 B 0 B
packages/abitype/dist/types/human-readable/formatAbi.d.ts 641 B 0 B
packages/abitype/dist/types/human-readable/formatAbiItem.d.ts 663 B 0 B
packages/abitype/dist/types/human-readable/formatAbiParameter.d.ts 452 B 0 B
packages/abitype/dist/types/human-readable/formatAbiParameters.d.ts 641 B 0 B
packages/abitype/dist/types/human-readable/parseAbi.d.ts 756 B 0 B
packages/abitype/dist/types/human-readable/parseAbiItem.d.ts 735 B 0 B
packages/abitype/dist/types/human-readable/parseAbiParameter.d.ts 990 B 0 B
packages/abitype/dist/types/human-readable/parseAbiParameters.d.ts 0 B 0 B 🆕
packages/abitype/dist/types/human-readable/runtime 486 B 0 B
packages/abitype/dist/types/human-readable/runtime/cache.d.ts 373 B 0 B
packages/abitype/dist/types/human-readable/runtime/signatures.d.ts 155 B 0 B
packages/abitype/dist/types/human-readable/runtime/structs.d.ts 691 B 0 B
packages/abitype/dist/types/human-readable/runtime/utils.d.ts 0 B 0 B 🆕
packages/abitype/dist/types/human-readable/types 1.8 kB 0 B
packages/abitype/dist/types/human-readable/types/signatures.d.ts 725 B 0 B
packages/abitype/dist/types/human-readable/types/utils.d.ts 422 B 0 B
packages/abitype/dist/types/narrow.d.ts 161 B 0 B
packages/abitype/dist/types/regex.d.ts 1.04 kB 0 B
packages/abitype/dist/types/register.d.ts 1.9 kB 0 B
packages/abitype/dist/types/types.d.ts 2.4 kB 0 B
packages/abitype/dist/types/utils.d.ts 92 B 0 B
packages/abitype/dist/types/version.d.ts 2.13 kB 0 B
packages/abitype/dist/types/zod.d.ts 0 B 0 B 🆕

compressed-size-action

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (f35e72e) to head (e81808d).

Current head e81808d differs from pull request most recent head c398a98

Please upload reports for the commit c398a98 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #244   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files          26       26           
  Lines        6108     6108           
  Branches      195      196    +1     
=======================================
  Hits         6099     6099           
  Misses          8        8           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tmm tmm merged commit 8a5e5dc into main Jun 28, 2024
4 checks passed
@tmm tmm deleted the tmm/fix-nested-tuple-parsing branch June 28, 2024 16:39
@github-actions github-actions bot mentioned this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typing issue with parseAbi(formatAbi(myABI)) : lost of types
1 participant